package logic.courseQuery_logic;

import java.util.List;

import po.StuCouScoRecPO;

public class SectionCounter {
	private ScoreSection sec;
	private List<StuCouScoRecPO> stuScoRec;
	public SectionCounter(ScoreSection sec, List<StuCouScoRecPO> stuScoRec) {
		super();
		this.sec = sec;
		this.stuScoRec = stuScoRec;
	}
	public ScoreSection getSec() {
		return sec;
	}
	public void setSec(ScoreSection sec) {
		this.sec = sec;
	}	
	public int getHeadScore() {
		return sec.getHeadScore();
	}
	public int getTailScore() {
		return sec.getTailScore();
	}
	public int count(){
		int num = 0;
		for(StuCouScoRecPO rec : stuScoRec){
			if(sec.within(rec.getScore())){
				num++;
			}
		}
		return num;
	}
}
